package com.ytjj.qmyx.users.enums;

/**
 * @Description TODO
 * @ClassName ReturnGoodsStatusEnums
 *
 * 
 * @Version 1.0
 **/
public enum ReturnGoodsStatusEnums {

    /**
     * 订单状态：0->未提交；1->退货中/审核中；2->等待寄回；3->已寄回待处理；4->成功；5->拒绝;6->撤销；7-失败；8-寄回中 9-退款成功
     */

    UN_COMMINT(0, "未提交"),
    WAIT_CHECK(1, "退货中/审核中"),
    WAIT_EXPRESS(2, "等待寄回"),
    EXPRESSED(3, "已寄回待处理"),
    SUCCESS(4, "成功"),
    REFUSE(5, "拒绝"),
    REVOKE(6, "撤销"),
    FAIL(7, "失败"),
    EXPRESSING(8, "寄回中"),
    REFUND_SUCCESS(9, "退款成功"),
    ;

    /**
     * 状态
     */
    private Integer status;
    /**
     * 状态描述
     */
    private String statusDesc;

    ReturnGoodsStatusEnums(Integer status, String statusDesc) {
        this.status = status;
        this.statusDesc = statusDesc;
    }

    public Integer getStatus() {
        return status;
    }

    public String getStatusDesc() {
        return statusDesc;
    }

    public static String getMessageByCode(Integer status){
        for (ReturnGoodsStatusEnums value : ReturnGoodsStatusEnums.values()) {
            if(value.getStatus().equals(status)){
                return value.getStatusDesc();
            }
        }
        return null;
    }

    public static Integer getCodeByMessage(String statusDesc){
        for (ReturnGoodsStatusEnums value : ReturnGoodsStatusEnums.values()) {
            if(value.getStatusDesc().equals(statusDesc)){
                return value.getStatus();
            }
        }
        return null;
    }
}
